//--------------------------------------------------------------------------
// reTouch main file
//--------------------------------------------------------------------------

#include "s3e.h"

// Externs for functions which examples must implement
void GameInit();
void GameShutDown();
void GameRender();
bool GameUpdate();

//--------------------------------------------------------------------------
// Main global function
//--------------------------------------------------------------------------

S3E_MAIN_DECL void IwMain()
{
#ifdef EXAMPLE_DEBUG_ONLY
// Test for Debug only examples
#endif


// Example main loop
GameInit();
while (1)
{
	s3eDeviceYield(0);
    s3eKeyboardUpdate();
    bool result = GameUpdate();
    if (
    		(result == false)
    		||
    		(s3eKeyboardGetState(s3eKeyEsc) & S3E_KEY_STATE_DOWN)
    		||
            (s3eKeyboardGetState(s3eKeyLSK) & S3E_KEY_STATE_DOWN)
            ||
            (s3eDeviceCheckQuitRequest())
       )
    	break;
    GameRender();
    s3eSurfaceShow();
}

	GameShutDown();

}
